home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / PS-files / getinfo.ps < prev    next >
Text File  |  1996-10-22  |  3KB  |  122 lines

  1. %!
  2. % Returns device info to host.
  3.  
  4. initgraphics
  5.  
  6. /newline {
  7.   (\r) print flush             % send carriage return
  8. } def
  9.  
  10. /s40 { 40 string } def
  11.  
  12. statusdict begin
  13.    revision                    % int
  14.    product dup                 % string
  15.    (Linotype) eq
  16.    { userdiskpercent           % percent
  17.      diskstatus                % free total
  18.      resolution                % int
  19.      true                      % we are running on a Linotronic
  20.    }
  21.    { false                     % we are running on some other device
  22.    } ifelse
  23. end
  24.  
  25. % true or false currently on top of stack
  26.  
  27. { (RESOLUTION  = ) print s40 cvs print newline
  28.   (DISK STATUS = ) print s40 cvs print
  29.   ( )              print s40 cvs print newline
  30.   (USER DISK % = ) print s40 cvs print newline
  31. } if
  32.  
  33. (PRODUCT  = ) print print newline
  34. (REVISION = ) print s40 cvs print newline
  35. (VERSION  = ) print version print newline
  36.  
  37. version cvr 25.0 gt            % PS version >= 25.0 ?
  38. {
  39.   newline
  40.   currentpacking               % bool
  41.   (CURRENT PACKING = ) print
  42.   s40 cvs print newline
  43.  
  44.   newline
  45.   currentcacheparams           % mark lower upper
  46.   (CURRENT CACHE PARAMS) print newline
  47.   counttomark
  48.      { s40 cvs print newline }
  49.   repeat
  50.   pop                          % remove mark
  51. } if
  52.  
  53. newline
  54. (CACHE STATUS) print newline
  55. cachestatus                    % bsize bmax msize mmax csize cmax blimit
  56. (blimit = ) print s40 cvs print newline
  57. (cmax   = ) print s40 cvs print newline
  58. (csize  = ) print s40 cvs print newline
  59. (mmax   = ) print s40 cvs print newline
  60. (msize  = ) print s40 cvs print newline
  61. (bmax   = ) print s40 cvs print newline
  62. (bsize  = ) print s40 cvs print newline
  63.  
  64. newline
  65. (VM STATUS) print newline
  66. vmstatus                       % savelevel vmused vmmax
  67. (vm max     = ) print s40 cvs print newline
  68. (vm used    = ) print s40 cvs print newline
  69. (save level = ) print s40 cvs print newline
  70.  
  71. newline
  72. (DEFAULT MATRIX = ) print
  73. matrix defaultmatrix                        % [ ? ? ? ? ? ? ]
  74. dup 0 get s40 cvs print ( ) print
  75. dup 1 get s40 cvs print ( ) print
  76. dup 2 get s40 cvs print ( ) print
  77. dup 3 get s40 cvs print ( ) print
  78. dup 4 get s40 cvs print ( ) print
  79. dup 5 get s40 cvs print ( ) print
  80. pop
  81. newline
  82.  
  83. /res 300 def
  84. /oshift -10.7 def
  85.  
  86. % switch to TeX portrait coordinate system:
  87.  
  88. initgraphics
  89. 72 res div dup neg scale                % units now device dots
  90. res oshift res mul translate            % move to TeX origin
  91.  
  92. newline
  93. (TeX PORTRAIT MATRIX = ) print
  94. matrix currentmatrix                  % [ ? ? ? ? ? ? ]
  95. dup 0 get s40 cvs print ( ) print
  96. dup 1 get s40 cvs print ( ) print
  97. dup 2 get s40 cvs print ( ) print
  98. dup 3 get s40 cvs print ( ) print
  99. dup 4 get s40 cvs print ( ) print
  100. dup 5 get s40 cvs print ( ) print
  101. pop
  102. newline
  103.  
  104. % switch to TeX landscape coordinate system:
  105.  
  106. initgraphics
  107. 90 rotate                                    % rotate axes 90deg anticlockwise
  108. 72 res div dup neg scale                % units now device dots
  109. res dup translate                            % move to TeX origin
  110.  
  111. newline
  112. (TeX LANDSCAPE MATRIX = ) print
  113. matrix currentmatrix                   % [ ? ? ? ? ? ? ]
  114. dup 0 get s40 cvs print ( ) print
  115. dup 1 get s40 cvs print ( ) print
  116. dup 2 get s40 cvs print ( ) print
  117. dup 3 get s40 cvs print ( ) print
  118. dup 4 get s40 cvs print ( ) print
  119. dup 5 get s40 cvs print ( ) print
  120. pop
  121. newline
  122.